package org.vectrics.recruiter.struts.tag;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.vectrics.common.pagelist.PageList;
import org.vectrics.company.CompanyPerson;

public class CompanyPersonRolePageList extends PageList {
	private transient static Log log = LogFactory.getLog(CompanyPersonRolePageList.class);
	private CompanyPerson companyPerson = null;
	//private JobCriteria criteria = null;
	
	public CompanyPersonRolePageList(CompanyPerson companyPerson) {
		super();
		this.companyPerson = companyPerson;
		this.setPageSize(50);
	}

	public List getElements(int startIndex, int endIndex) {
		List elements = new ArrayList();
		elements.addAll(companyPerson.getRoles());
		return(elements);
	}

	protected boolean usePageListing() {
		return(false);
	}

	public int getTotalElementCount() {
		int size = getElements(0, 5000).size();
		return(size);
	}

}
